<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<%@include file="../include/include.jsp"%>
	<link rel="stylesheet" type="text/css" href="${csspath}/public.css"/>
	<link rel="stylesheet" type="text/css" href="${csspath}/datepicker.css"/>
	<script src="${jspath}/jquery/jquery-1.4.4.js" type="text/javascript"></script>
	<script src="${jspath}/jquery/jquery.ui.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="${jspath}/ui.datepicker_zh-CN.js"></script>
	<script type="text/javascript" src="${jspath}/jquery/jquery.blockUI.js"></script>
	<script type="text/javascript" src="${jspath}/public.js"></script>
	
	<script type="text/javascript" src="${jspath}/jquery/jquery.ui.draggable.js"></script>
	<script type="text/javascript" src="${jspath}/jquery/jquery.alerts.js"></script>
	<link rel="stylesheet" type="text/css" href="${csspath}/jquery.alerts.css" />
	
		<script src="${jspath}/jquery/validate/jquery.validationEngine.js" type="text/javascript"></script>
<script src="${jspath}/jquery/validate/jquery.validationEngine-zh.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="${webcontext}/css/validationEngine.jquery.css"/>
	<link rel="stylesheet" type="text/css"
	href="${bootstrapPath}/css/bootstrap.css" />
<script type="text/javascript" src="${bootstrapPath}/js/bootstrap.js"></script>
	
<title>零售管理-修改短信模板</title>
<script type="text/javascript">
	function search(){
		document.getElementById("search_form").submit();
	}
	$(function(){
		//选中后该行高亮
		$('#search_form tr').bind('click', function() {
			 if(window.cur) window.cur.style.background = "";  
			 if(window.cur) window.cur.style.fontWeight = "normal";  
	         this.style.background = "#e8e8e8";
	         this.style.fontWeight = "bold";
	         window.cur = this; 
		});
		
		// 设置鼠标点击行时选中改行第一列的单选按钮
		$("#search_form tr").click(function(){
			$(this).find("td input[type='radio']").attr("checked",true);
			$(this).find("td input[type='radio']").click();
		});
		
		$("#search_form").validationEngine({
			///validationEventTriggers:"change blur",
			promptPosition:"topLeft"
		});
		$("#edit").click(function(){
			var radioVal = $("input:radio:checked").val();
			if (radioVal != undefined) {
				$("#edit").attr("href","${webcontext}/sms/edit/"+radioVal);
			}else{
				jAlert("请选择记录！","提示信息");
			}
		});
		$(".delete").click(function(){
			var radioVal = $("input:radio:checked").val();
			if (radioVal != undefined) {
				jConfirm("确认删除此记录？","操作提示",function(result){
					if(result == true){
						$("#deleteForm").attr("action","${webcontext}/sms/delete/"+radioVal);
						$("#deleteForm").submit();
					}
				});
			}else{
				jAlert("请选择记录！","提示信息");
			}
		});
	});
	function exportdata(){
		$("#search_form").attr("action","${webcontext}/sms/exportShortMessageTemplate");
		$("#search_form").submit();
		$("#search_form").attr("action", "${webcontext}/sms/querysmstemplates");
	}
</script>
</head>
<body>
<form action="" id="deleteForm"></form>
<!-- content -->
	<div id="content">
		<!-- wrap -->
		<div id="wrap">
			<!-- breadcrumb -->
			<div id="breadcrumba" style="color: #025D7B; height: 26px; line-height: 26px;">
				<span>设置</span>
				<span>&gt;</span>
				<span>修改短信模板</span>
			</div>
		</div>
			<!-- /breadcrumb -->
			<form:form id="search_form" class="form-horizontal" action="${webcontext}/sms/querysmstemplates" method="post" modelAttribute="queryDto">
            <div class="">
			<div class="row" style="margin-top: 10px;">
				<div class="form-group">
					<label class="col-sm-4 control-label">短信模板名称：</label>
					<div class="col-sm-3">
						<form:input path="messageTemplateComments" cssClass="form-control input-sm"/>
					</div>
					<label class="col-sm-2 control-label">模板内容：</label>
					<div class="col-sm-3">
						<form:input path="messageTemplateContent"  cssClass="form-control input-sm"/>
					</div>
					<%-- <td class="label">有效日期：</td>
					<td>
						<form:input path="validateDate" cssClass="validate[optional,custom[date]] text date"/>
					</td>
					<td class="label">失效日期：</td>
					<td>
						<form:input path="expiredDate" cssClass="validate[optional,custom[date]] text date"/>
					</td> --%>
				</div>
				</div>
				<div style="text-align: center; margin-top: 10px;">
					<button type="submit" class="btn btn-success"><i class="glyphicon glyphicon-search" style="color:#FFFFFF"></i>&nbsp;查询</button>
					<button type="reset" class="btn btn-success"><i class="glyphicon glyphicon-trash" style="color:#FFFFFF"></i>&nbsp;重置</button>
				</div>
			<div class="spliter h_10"></div>
			<!-- /input_table -->
		</div>
		<!--<core:choose>
				<core:when test="${initPage}">
					请输入查询参数
				</core:when>
				<core:when test="${resultDtoList == null || empty resultDtoList}">
					没有查询结果
				</core:when>
				<core:otherwise>
				</core:otherwise>
			</core:choose>
        <div class="spliter h_10"></div>-->
			<!-- page_div -->
			<div class="page_div">
				<div class="page_info">
				<div class="spliter h_5"></div>
				<div class="page_info"></div>
				<div class="spliter h_10"></div>
					<a id="edit" class="btn btn-default btn-xs" style="padding-left: 0;width: 50px;border: 0;" href="#"><i class="glyphicon glyphicon-pencil" style="color:#449d44;"></i>&nbsp;<font style="color: #449d44;">修改</font></a>
					<!--  <a class="delete">删除</a>-->
					<!-- <a class="export" onclick="exportdata();">导出</a> -->
				</div>
			</div>
			<!-- /page_div -->

			<!-- data_div -->
			<div class="data_div">
				<table class="table table-hover">
				<thead>
					<tr>
						<th width="5%">选择</th>
						<th width="10%">短信模板名称</th>
						<!-- <th class="w_8">作用范围</th> -->
						<th width="75%">短信内容</th>
						<!-- <th class="w_10">预定发送时间</th>
						<th class="w_8">生效日期</th>
						<th class="w_8">失效日期</th> -->
					</tr>
				</thead>
				<tbody>
					<core:forEach items="${resultDtoList}" var="result">
						<tr>
						<td class="align_m">
							<input type="radio" name="radio1" value="${result.id }" />
						</td>
						<td style="width:20%">${result.messageTemplateComments }</td>
						<%-- <td>${result.effectScopeName }</td> --%>
						<td>${result.messageContent }</td>
						<%-- <td>
							<fmt:formatDate value="${result.scheduledSendTime }" pattern="HH:mm" timeStyle="long"/>
						</td>
						<td><fmt:formatDate value="${result.effectiveDate }" pattern="yyyy-MM-dd"/></td>
						<td><fmt:formatDate value="${result.expiryDate }" pattern="yyyy-MM-dd"/></td> --%>
					</tr>
					</core:forEach>
				</tbody>
				</table>
			</div>
			<!-- /data_div -->

			<!-- page_div -->
			<div class="page_div">
				<%@include file="../common/page.jsp"%>
			</div>
			<!-- /page_div -->
			</form:form>
		</div>
		<!-- /wrap -->
	<!-- /content -->
</body>
</html>